﻿// --------------------------------------------------------------------------------------------------------------------- 
// <copyright file="Problem7.cs" company="Microsoft">
//   Copyright (c) Microsoft Corporation.  All rights reserved. THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
// </copyright>
// <summary>
//   Defines the Problem7 type.
// </summary>
// ---------------------------------------------------------------------------------------------------------------------
namespace EulerProblemsCSharp.Problems
{
    using System.Linq;

    /// <summary>
    /// Problem 7.
    /// </summary>
    public class Problem7 : ProblemBase
    {
        /// <summary>
        /// Gets Number.
        /// </summary>
        /// <value>
        /// The number.
        /// </value>
        public override int Number
        {
            get
            {
                return 7;
            }
        }

        /// <summary>
        /// Gets Description.
        /// </summary>
        /// <value>
        /// The description.
        /// </value>
        public override string Description
        {
            get
            {
                return "What is the 10001st prime number?";
            }
        }

        /// <summary>
        /// Solves problem 7.
        /// </summary>
        /// <returns>
        /// The solution.
        /// </returns>
        public override object Solve()
        {
            var answer = new SieveOfEratosthenes().GetPrimes(1000000)
                    .Skip(10000)
                    .First();

            return answer;
        }
    }
}